package org.moyu.filter;

import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author 李伟国
 * 时间 2024年12月07日20:46:11
 * 描述 捕获异常
 */

@Slf4j
@RestController
public class ExceptionFilterController {
    /**
     * 重新抛出异常
     */
    @RequestMapping("/error/exception/throw")
    public void rethrow(HttpServletRequest request) throws Exception {
        throw (Exception) request.getAttribute("filter.error");
    }
}
